package com.weixing.mall.leaf.api.service;

import com.weixing.mall.leaf.api.hystrix.IdGenServiceFallback;
import com.weixing.mall.leaf.api.hystrix.LogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @ClassName IdGenServiceRpc
 * @Description
 * @Author Small
 * @Date 2019/10/14 16:07
 * @Version 1.0
 **/
@FeignClient(value ="leaf-server",configuration = FeignRibbonClientAutoConfiguration.class,fallback = IdGenServiceFallback.class)
public interface IdGenServiceRpc {

    @GetMapping("/api/segment/get/{key}")
    public long  segmentKey(@PathVariable("key") String key);

    @GetMapping("/api/snowflake/get/{key}")
    public long snowFlakeKey(@PathVariable( "key") String key);
}
